import { Typography } from "antd";
import React from "react";

const CartItem = (props) => {
    const {item, onCheckedChange} = props
    const {checked, name, price} = item
    // const onWrappCheckedChange = () => {
    //     onCheckedChange(item)
    // }
    return (
        <div className="item-card">
            <div className="checkbox-wrap">
                <input 
                    type="checkbox"
                    checked={checked}
                    onChange={onCheckedChange.bind(null, item)}
                />
            </div>
            <div className="item-info">
                {name}<Typography.Text mark>${price}</Typography.Text>
            </div>
        </div>
    )
}

export default CartItem